﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.SQL.Core
{
    public interface ISQLSelectExpression
    {
        ISQLTableExpression From(params string[] tables);
    }

    public interface ISQLTableExpression : ISQLEndCreator
    {
        ISQLTableExpression InnerJoin(string table);

        ISQLTableExpression Join(string table);

        ISQLTableExpression LeftJoin(string table);

        ISQLTableExpression RightJoin(string table);


        ISQLMiddleExpression On(string column);

        ISQLExpression Where(string table);

        ISQLGroupBy GroupBy(params string[] columns);

        ISQLEndCreator OrderBy(params string[] columns);

    }

    public interface ISQLExpression
    {
        ISQLExpressionRight Equal(object column);

        ISQLExpressionRight Less(object column);

        ISQLExpressionRight Great(object column);

        ISQLExpressionRight LessEqual(object column);

        ISQLExpressionRight GreatEqual(object column);

        ISQLExpressionRight NotEqual(object column);

        ISQLExpressionRight Like(object column);


        ISQLExpressionRight Equal(object column, bool isParameter);

        ISQLExpressionRight Less(object column, bool isParameter);

        ISQLExpressionRight Great(object column, bool isParameter);

        ISQLExpressionRight LessEqual(object column, bool isParameter);

        ISQLExpressionRight GreatEqual(object column, bool isParameter);

        ISQLExpressionRight NotEqual(object column, bool isParameter);

        ISQLExpressionRight Like(object column, bool isParameter);


        ISQLExpressionRight IsNull();

        ISQLExpressionRight IsNotNull();

        ISQLSelectExpression InSelect(params string[] columns);

        ISQLSelectExpression NotInSelect(params string[] columns);

        ISQLSelectExpression InSelectAll();

        ISQLSelectExpression NotInSelectAll();

    }

    public interface ISQLExpressionRight : ISQLEndCreator
    {
        ISQLExpressionRight Brace { get;}

        ISQLExpressionRight BraceEnd { get;}

        ISQLExpression And(string column);

        ISQLExpression Or(string column);

        ISQLGroupBy GroupBy(params string[] columns);

        ISQLEndCreator OrderBy(params string[] columns);
    }

    public interface ISQLMiddleExpression
    {
        ISQLMiddleExpressionRight Equal(object column);

        ISQLMiddleExpressionRight Less(object column);

        ISQLMiddleExpressionRight Great(object column);

        ISQLMiddleExpressionRight LessEqual(object column);

        ISQLMiddleExpressionRight GreatEqual(object column);

        ISQLMiddleExpressionRight NotEqual(object column);

        ISQLMiddleExpressionRight Equal(object column, bool isParameter);

        ISQLMiddleExpressionRight Less(object column, bool isParameter);

        ISQLMiddleExpressionRight Great(object column, bool isParameter);

        ISQLMiddleExpressionRight LessEqual(object column, bool isParameter);

        ISQLMiddleExpressionRight GreatEqual(object column, bool isParameter);

        ISQLMiddleExpressionRight NotEqual(object column, bool isParameter);
    }

    public interface ISQLMiddleExpressionRight : ISQLTableExpression, ISQLEndCreator
    {
        ISQLMiddleExpressionRight Brace { get;}

        ISQLMiddleExpressionRight BraceEnd { get;}

        ISQLMiddleExpression And(string column);

        ISQLMiddleExpression Or(string column);
    }

    public interface ISQLGroupBy : ISQLEndCreator
    {
        ISQLEndCreator OrderBy(params string[] columns);
    }
}
